package com.l;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

public class F {
    public static List<String> readTextFile(String filePath){
        List<String> list=new ArrayList<>();
        File file = new File(filePath);
        if (file.isFile() && file.exists()) {
            try {
                InputStreamReader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
                BufferedReader bufferedReader = new BufferedReader(reader);
                String lineTxt = null;
                while ((lineTxt = bufferedReader.readLine()) != null) {
                    list.add(lineTxt);
                }
                reader.close();
            } catch (IOException e) {
                System.out.println("读取文件内容出错");
                e.printStackTrace();
            }
        } else {
            System.out.println("找不到指定的文件");
        }
        return list;
    }

    public static void main(String[] args) {
        String filePath="C:\\Users\\xyh14\\Documents\\Tencent Files\\3181859874\\FileRecv\\config.plist";
        List<String> list = readTextFile(filePath);
        String filePath2="C:\\Users\\xyh14\\Documents\\Tencent Files\\3181859874\\FileRecv\\config1.plist";
        List<String> list2 = readTextFile(filePath2);
        for (int i = 0; i < list.size(); i++) {
            if (!list.get(i).equals(list2.get(i))) {
                System.out.println("不相同的是=="+i+list.get(i));
            }
        }
    }
}
